<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
      //Object.assign合并对象，并且里面的值是唯一de
      let target ={a:1, b:1}
      let source = {b:2 ,c :1}
      console.log(Object.assign(target,source))
      //Object.create 创建一个新对象
      let create = {c:1}
      let add = Object.create(create)
      add.name ='lisi'
      console.log(add)
      //创建一个纯对象
      const obj = Object.create(null)

      //vue源码函数caches
       function cache(){
        const obj = Object.create(null)
        return function cached(str){
            let hit = obj[str]
            return hit || (obj[str] =fn(str))

        }
       }
       function sum(num){
        let total = 0
        for(var i = 1 ;i < num ; i++){
            total += i
        }
        return  cacheSum = cache(sum)
       }

    </script>
</body>
</html>